﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace demo3
{
    class text
    {
        public int id;
        public string bookname;
        public int money;
        public string press;
        public string writer;

        public int Id
        {
            get
            {
                return id;
            }
            set
            {
                id = value;
            }
        }
        public string Bookname
        {
            get
            {
                return bookname;
            }
            set
            {
                bookname = value;
            }
        }
        public int Money
        {
            get
            {
                return money;
            }
            set
            {
                if (money < 0)
                {
                    money = 0;
                }
                else
                {
                    money = value;
                }
            }
        }
        public string Press
        {
            get
            {
                return press;
            }
            set
            {
                press = value;
            }
        }
        public string Writer
        {
            get
            {
                return writer;
            }
            set
            {
                writer = value;
            }
        }

        public void c()
        {
            Console.WriteLine("编号：" + id);
            Console.WriteLine("书名：" + bookname);
            Console.WriteLine("价格：" + money);
            Console.WriteLine("出版社：" + press);
            Console.WriteLine("作者信息：" + writer);


        }
    }
}
